<?php
require_once('../../execute/inc/config.inc');
$link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
if(!$link) {
	die('Failed to connect to server: ' . mysql_error());
}

//Select database
$db = mysql_select_db(DB_DATABASE);
if(!$db) {
	die("Unable to select database");
}
$qry = mysql_query("INSERT INTO course_student values (null,'".$_GET['cid']."','".$_GET['sid']."',NOW())");
if($qry){
	header("Location: ../index.php?join=success");
}
else{
	header("Location: ../index.php?join=fail");
}
?>